<div id="student-add" >
    <p></p>
    <form class="form-horizontal">
        <div class="form-group">
            <label for="inputstudent1" class="col-sm-2 control-label">学员名</label>
            <div class="col-sm-8">
                <input type="email" class="form-control"  v-model="student.studentName" id="inputstudent1"
                    placeholder="用户名">
            </div>
        </div>
        <div class="form-group">
            <label for="inputstudent2" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-8">
                <input type="password" class="form-control"  v-model="student.loginPass" id="inputstudent2"
                    placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <label for="inputstudent21" class="col-sm-2 control-label">手机号</label>
            <div class="col-sm-8">
                <input type="text" class="form-control"  v-model="student.studentTel" id="inputstudent21"
                    placeholder="手机号">
            </div>
        </div>

        
        <div class="form-group">
            <label for="studentsave31" class="col-sm-2 control-label">性别</label>
            <div class="col-sm-10">
              <label class="radio-inline">
                <input type="radio" v-model="student.studentGender" name="itemGender" id="studentsave31" value="1">
                男
              </label>
              <label class="radio-inline">
                <input type="radio" v-model="student.studentGender" name="itemGender" id="studentsave41" value="2">
                女
              </label>
            </div>
          </div>

        <div class="form-group" >
            <label for="inputStudent3" class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                <label class="radio-inline">
                    <input type="radio" v-model="student.studentStatus" name="inputStudent3"
                        id="inputstudent3" value="1"> 正常
                </label>
                <label class="radio-inline">
                    <input type="radio" v-model="student.studentStatus" name="inputStudent3"
                        id="inputstudent4" value="2"> 禁用
                </label>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="button" @click="saveStudent" class="btn btn-default"
                    value="保存"></input>
                <!-- <input :class="{disabled:addItemIsDisabled}" @click="showAddItem" type="button"
                    class="btn  btn-default" value="新增模版项"></input> -->
            </div>
        </div>
    </form>
</div>

<script>
    let appStudent= Vue.createApp({
        data() {
            return {
                student:{}
            }
        },
        methods: {
            saveStudent(){
                axios.post("http://localhost:8080/student/save",this.student).then((res)=>{
                    if(res.data.status==505){
                        showMsg("模版名称重复","提示");
                        // 可以切换模版标题输入框的样式
                    }else{
                        showMsg("保存成功","保存提示");
                        this.student={}

                        showOrCheckTab("用户列表", "student-list.html");
                    }
                }); 
            }
        },
    })
    appStudent.mount("#student-add")
</script>